package cz.proks.schoolpupilbook.gae.dbo;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.google.appengine.api.datastore.Key;

@Entity
public class MarkCommentDBO implements IsIndexableDBO {
	private Key id;
	private MarkDBO mark;
	private Key contributorKey;
	private Date time;
	private String comment;
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)	
	public Key getId() { 
		return id;
	}
	
	public void setId(Key id) {
		this.id = id;
	}

	@ManyToOne
	public MarkDBO getMark() {
		return mark;
	}

	public void setMark(MarkDBO mark) {
		this.mark = mark;
	}

	@Basic
	@Column(nullable=false)
	public Key getContributorKey() {
		return contributorKey;
	}

	public void setContributorKey(Key contributorKey) {
		this.contributorKey = contributorKey;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(nullable=false)
	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	@Basic
	@Column(nullable=false)
	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}	
}
